<?php
class Gallery extends ActiveRecord\Model{
	
	static $belongs_to = array(
	array('aauth_user','class_name'=>'aauth_user', 'foreign_key' => 'aauth_user_id','select' => ' name')
	
	);
	
	public static function find_num_rows()
	{
		$array = self::first(array('select' => 'count(*) AS num_rows'))->attributes();

		return $array['num_rows'];
	}
}